import { mkdir } from 'fs';
import {isDevelopment} from '@/config/env_config'

const pathExec = process.cwd();

// 创建文件夹
const addfolder = function (name) {
  let newpath
  if (isDevelopment) {
    newpath = name ? ((pathExec + '\\dist_electron') + ('\\' + name)) : (pathExec + '\\dist_electron');
  }
  else {
    newpath = name ? (pathExec + ('\\' + name)) : pathExec;
  }
  mkdir(newpath, { recursive: true }, (err) => {
    if (err) throw err;
  });
}

export {
  addfolder
}
